package com.penghk.springbootdemo.mq.direct;

import com.penghk.springbootdemo.entity.User;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
@RabbitListener(queues = "userQueue")
public class UserReceiver {

    @RabbitHandler
    public void receiveEntity(User user) {
        System.out.println(user.getName()+" : "+user.getAge());
    }

}
